import "amfe-flexible";
const baseSize = 16;
const setRem = () => {
  const scale = document.documentElement.clientWidth / 1920;
  console.log(scale);
  // 设置页面根节点字体大小, 字体大小最小为12

  const fontSize = baseSize * Math.min(scale, 1) > 12 ? baseSize * Math.min(scale, 1) : 12;
  document.documentElement.style.fontSize = fontSize + "px";
};
//初始化
setRem();
//改变窗口大小时重新设置 rem,这里最好加上节流
window.onresize = function () {
  setRem();
};
